import java.util.Scanner;

//游游的you
public class Test3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int q = sc.nextInt();
        while(q-- != 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = Math.min(a,Math.min(b,c));
            System.out.println(2*x+ Math.max(b-x-1,0));
        }

    }
}
